<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>DataSource</title>
    <link rel="stylesheet" href="js/layui/css/layui.css"/>
    <link rel="stylesheet" href="css/layui-blue.css"/>
    <script type="text/javascript" src="js/layui/layui.all.js"></script>
</head>
<body style="padding:5px;">
<table class="layui-table" id="table" lay-filter="table"></table>
<script>
    var $ = layui.$;
    var $table = layui.table.render({
        id: 'table',
        elem: '#table',
        url: 'logs/list',
        method: 'post',
        headers: {Authorization: sessionStorage.getItem("userToken")},
        page: true,
        parseData: function (resp) {
            return {
                code: resp.code,
                msg: resp.message,
                data: resp.data.records,
                count: resp.data.total
            }
        },
        cols: [[
            {
                title: '操作时间',
                width: 200,
                field: 'createTime',
                align: 'center'
            }, {
                title: '操作类型',
                width: 160,
                field: 'logsType',
                templet: function (thisLog) {
                    console.log(thisLog);
                    var res = "";
                    switch (thisLog.logsType) {
                        case 10001:
                            res = "登陆日志"
                            break;
                        case 10003:
                            res = "修改-基本资料"
                            break;

                    }
                    return res;
                },
                align: 'center'
            }, {
                title: '操作用户',
                width: 160,
                field: 'createName'
            }, {
                title: 'ip地址',
                width: 160,
                field: 'ip',
            }, {
                title: '操作内容',
                align: 'center',
                field: 'remarks'
            }]]
    })

</script>
<script type="text/html" id="buttons">
    <a class="layui-btn layui-btn-sm btn-edit" data-id="{{d.id}}">编辑</a>
    <a class="layui-btn layui-btn-sm btn-remove" data-id="{{d.id}}">删除</a>
</script>
</body>
</html>